package routes

import (
	"goserver/handlers"
	"goserver/models"

	"go.mongodb.org/mongo-driver/mongo"
)

func SetupUserRoutes(db *mongo.Database, collectionName string) {
	userRepo := models.NewUserRepository(db, collectionName)
	userHandler := handlers.NewUserHandler(userRepo)

	setupEntityRoutes[models.User]("/user/add", userHandler.AddUser)
	setupEntityRoutes[models.User]("/user/delete", userHandler.DeleteUser)
	setupEntityRoutes[models.User]("/user/update", userHandler.UpdateUser)
	setupEntityRoutes[models.User]("/user/list", userHandler.GetUserList)
	setupEntityRoutes[models.User]("/user/info", userHandler.GetUserInfo)
	setupEntityRoutes[models.User]("/user/login", userHandler.UserLogin)
}
